 /***************************************************************************
 *   Copyright (C) 2010 by ZhangShine , All Rights Reserved                                  
 *   zhangshine0125@gmail.com                                              
 *                                                                         
 *   This program is free software; you can redistribute it and/or modify  
 *   it under the terms of the GNU General Public License as published by  
 *   the Free Software Foundation; either version 2 of the License, or     
 *   (at your option) any later version.                                   
 *                                                                         
 *   This program is distributed in the hope that it will be useful,       
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         
 *   GNU General Public License for more details.                          
 *                                                                         
 *   You should have received a copy of the GNU General Public License     
 *   along with this program; if not, write to the                         
 *   Free Software Foundation, Inc.,                                       
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             
 ***************************************************************************/

#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#include <QSettings>

/*! \class Configuration
 * \brief 应用程序配置信息
 *
 *
 */
class Configuration
{
public:
    Configuration();
    bool saveSettings();
    bool loadSettings();
    void saveAccountConf(QString id, int homeC, int atMeC, int userC, int commentC, int dMC, int updateTime);
    int getAccountConf(QString id, QString key);
    void setAccountCont(QString id, QString key, QVariant value);
    bool getTokenByEmailAddress( const QString &emailAddress, QString &accessToken, QString &accessTokenSecret );
    void saveTokenByEmailAddress( const QString &emailAddress, const QString &accessToken, const QString &accessTokenSecret );
    QString getRemeberedUsername();
    QString getRemeberedPassword();
    void setRemeberedUP(QString username, QString password);
    void setWindowSize(int width, int height);
    void getWindowSize(int &width, int &height);
    QString getProfilesDir();
   static Configuration* getInstance();
   
public:
    static Configuration* instance;
    static const QString accessToken;
    static const QString accessTokenSecret;
    QSettings *settings;
    QString homeCS;
    QString atMeCS;
    QString userWeiboCS;
    QString favoriteCS;
    QString commentCS;
    QString directMessageCS;
    QString isNotifyCS;
    QString id;
    QString profilePath;
    QString updateStatusS;
};

#endif // CONFIGURATION_H
